package com.tqjc.business.interactivewithscan.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tqjc.business.interactivewithscan.entity.DeviceAction;
import com.tqjc.business.interactivewithscan.mapper.DeviceActionMapper;
import com.tqjc.business.interactivewithscan.service.DeviceActionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @program: C20005_Xianggang_new
 * @description: 动作表服务实现类
 * @author: Patienyon
 * @create: 2023-11-01 19:29
 **/

@Service
@Slf4j
public class DeviceActionServiceImpl extends ServiceImpl<DeviceActionMapper, DeviceAction> implements DeviceActionService {

    @Override
    public DeviceAction queryAction(int deviceId, String actionCode) {
        log.error("当前查询的设备id为{}，操作编号为{}",deviceId,actionCode);
        LambdaQueryWrapper<DeviceAction> actionQuery = new LambdaQueryWrapper<>();
        actionQuery.eq(DeviceAction::getDeviceFk, deviceId);
        actionQuery.eq(DeviceAction::getDeviceActionCode, actionCode);
        DeviceAction action = this.getOne(actionQuery);
        return action;
    }
}